package com.songlanyun.modules.order.model.vo;

import com.songlanyun.common.drive.ValueObject;
import com.songlanyun.common.enums.GoodsConstant;
import com.songlanyun.common.utils.custom.MathUtils;
import com.songlanyun.modules.marketing.firstorder.entity.FirstOrderActivity;
import com.songlanyun.modules.order.model.dto.SubmitChildOrderDTO;
import com.songlanyun.modules.order.model.dto.SubmitOrderUseCoupon;
import lombok.Data;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;

@Data
public class SubmitShopOrderVo implements ValueObject
{
    /**
     * 订单类型
     */
    private Integer orderType = 1;
    //订单所属店铺id
    private Long shopId;
    //来源店铺id
    private Long sourceShopId;
    //是否是平台店
    private Boolean platformShop;
    //订单所属店铺名称
    private String shopName;
    //来源店铺名称
    private String sourceShopName;

    //活动类型营销活动内类型(0无活动，1秒杀，2拼团）
    private Integer marketingType = 0;
    //活动id
    private Long activityId=0L;
    //活动标题
    private String activityTitle="";

    //活动发起信息id(如果是限时折扣和首单优惠活动，其为0，如果是拼团其为发起的团Id
    private Long sponsorActivityId=0L;

    private List<SubmitChildOrderVo> items;



    //分单实际商品总价
    private BigDecimal totalGoodsAmount;

    //原商品总价
    private BigDecimal originalGoodsAmount;


    public BigDecimal getDiscountAmount()
    {
        return MathUtils.subtract(originalGoodsAmount,totalGoodsAmount);
    }

    //首单优惠多少钱
    private BigDecimal firstOrderReduced;
    //总优惠多少钱
    private BigDecimal totalReduced;

    //分单总价
    private BigDecimal totalAmount;

    //不含运费的费用
    private BigDecimal totalAmountNoFreight;

    //不含运费，扣出首单，没扣除优惠券的费用
    private BigDecimal totalAmountNoCoupon;

    //不含运费，扣出首单，扣除店铺优惠券的费用
    private BigDecimal totalAmountDecShopCoupon;

    //不含运费，扣出首单，扣除店铺优惠券的费用,扣出平台抵扣积分
    private BigDecimal totalAmountDecPlatformPoint;

    //分单运费
    private BigDecimal totalFreight;

    //总数量
    private Integer goodsNum;

    //总成本
    private BigDecimal totalCost;

    //用户备注说明
    private String userRemark="";

    /**
     * 下单会员所在商家等级编码
     */
    private String userRoleCode;
    /**
     * 下单会员所在商家等级名称
     */
    private String userRoleName;

    /**
     * 首单优惠活动
     */
    private FirstOrderActivity firstOrderActivity;

    /**
     * 是否是积分订单
     */
    private Boolean pointGoods = false;

    /**
     * 是不是积分兑换订单
     */
    private Boolean exchange = false;

    //是否是服务体系商品
    private Boolean serviceSystemGoods=false;

    /**
     * 兑换积分是多少
     */
    private BigDecimal totalPoint = BigDecimal.ZERO;

    /**
     * 总共需要赠送多少
     */
    private BigDecimal totalGiveBackPoint = BigDecimal.ZERO;
    /**
     * 总共需要赠送多少消费什
     */
    private BigDecimal totalConsumptionValue= BigDecimal.ZERO ;

    /**
     * 平台券分摊多少钱
     */
    private BigDecimal platformCouponSharing = BigDecimal.ZERO;

    /**
     * 店铺券
     */
    private SubmitOrderUseCoupon shopCoupon = SubmitOrderUseCoupon.buildEmpty();


    /**
     * 平台券
     */
    private SubmitOrderUseCoupon platformCoupon = SubmitOrderUseCoupon.buildEmpty();

    /**
     * 商品分区特征(0,普通商品,1服务体系礼包,2新人福利区,3公益申领)
     */
    private GoodsConstant.AreaFeature areaFeature;


    //=============================================================================

    /**
     *  是否是第三方商品
     */
    private Boolean third;

    private String houniaoSpuId;

    private Integer source;



}
